package hello;

import java.util.Scanner;
//判断某年某月某日是星期几
public class Text4 {
	public static void main(String[] args) {
		/*Scanner in=new Scanner(System.in);
		System.out.println("请输入年：");
		int y=in.nextInt();
		System.out.println("请输入月：");
		int m=in.nextInt();
		System.out.println("请输入日：");
		int d=in.nextInt();
		int j=0,i,total = 0;
		for(i=1900;i<=y;i++){
			if(y%4==0&&y%100!=0||y%400==0)
				j+=1;
		}//判断有几个瑞年
		if(y%4==0&&y%100!=0||y%400==0){//是瑞年
			switch(m-1){
			case 1:total=31;break;
			case 2:total=29+31;break;
			case 3:total=31+29+31;break;
			case 4:total=31+29+31+30;break;
			case 5:total=31+29+31+30+31;break;
			case 6:total=31+29+31+30+31+30;break;
			case 7:total=31+29+31+30+31+30+31;break;
			case 8:total=31+29+31+30+31+30+31+31;break;
			case 9:total=31+29+31+30+31+30+31+31+30;break;
			case 10:total=31+29+31+30+31+30+31+31+30+31;break;
			case 11:total=31+29+31+30+31+30+31+31+30+31+30;break;
			case 12:total=31+29+31+30+31+30+31+31+30+31+30+31;break;
			default:System.out.println("输入错误！");
			}
		}
		else switch(m-1){//不是瑞年
		case 1:total=31;break;
		case 2:total=28+31;break;
		case 3:total=31+28+31;break;
		case 4:total=31+28+31+30;break;
		case 5:total=31+28+31+30+31;break;
		case 6:total=31+28+31+30+31+30;break;
		case 7:total=31+28+31+30+31+30+31;break;
		case 8:total=31+28+31+30+31+30+31+31;break;
		case 9:total=31+28+31+30+31+30+31+31+30;break;
		case 10:total=31+28+31+30+31+30+31+31+30+31;break;
		case 11:total=31+28+31+30+31+30+31+31+30+31+30;break;
		case 12:total=31+28+31+30+31+30+31+31+30+31+30+31;break;
		default:System.out.println("输入错误！");
		}
		int days;
		days=(y-1900)*365+j+total+d;//总共有多少天
		switch(days%7){
		case 0:System.out.println("今天是星期天。");break;
		case 1:System.out.println("今天是星期一。");break;
		case 2:System.out.println("今天是星期二。");break;
		case 3:System.out.println("今天是星期三。");break;
		case 4:System.out.println("今天是星期四。");break;
		case 5:System.out.println("今天是星期五。");break;
		case 6:System.out.println("今天是星期六。");break;
		default:System.out.println("输入错误！");
		}
		System.out.println("程序结束。");
		in.close();*/
		
		Scanner sc=new Scanner(System.in);
		System.out.println("请分别输入年月日：");
		int y=sc.nextInt();
		int m=sc.nextInt();
		int d=sc.nextInt();
		int i,j=0,t,k;
		for(i=1900;i<=y;i++){
			if(i%4==0&&i%100!=0||i%400==0)
				j+=1;
		}
		t=(y-1900)*365+j;
		for(k=1;k<m;k++){
		switch(k){
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:
			t+=31;break;
		case 4: 
		case 6:
		case 9:
		case 11:
		    t+=30;break;
		case 2:
			if(y%4==0&&y%100!=0||y%400==0)
				t+=29;
			else  t+=28;
		}
		}
	t+=d;
	switch(t%7){
	case 0:System.out.println("星期天");break;
	case 1:System.out.println("星期一");break;
	case 2:System.out.println("星期二");break;
	case 3:System.out.println("星期三");break;
	case 4:System.out.println("星期四");break;
	case 5:System.out.println("星期五");break;
	case 6:System.out.println("星期六");break;
	}
	System.out.println("程序结束！");
}
}
